﻿@{
    ViewBag.Title = "Personal";
    Layout = "~/Views/Shared/_Layout.cshtml";
 
}
@using Helena.Areas.Vendedores.Models
@model IEnumerable<VendedorView>           
@using Telerik.Web.Mvc.UI

<div class="block big" style="position: relative">
    <!-- Block Begin -->
    <div class="titlebar">
        <h3>
            Administración de Personal
        </h3>
    </div>
    <div class="block_cont">
        @(Html.Telerik().Grid(Model)
        .Name("VendedoresGrid")
        .Filterable()
        .ToolBar(commands => commands.Insert())
        .Editable(editing => editing
                            .Mode(GridEditMode.PopUp)
                            .TemplateName("VendedorViewTemplate"))
        .DataKeys(key => key.Add(c => c.ID))
        .Columns(columns =>
        {
            columns.Bound(c=>c.Nombre);
            columns.Bound(c => c.apaterno);
            columns.Bound(c => c.amaterno);
            columns.Bound(c => c.Telefono);
            columns.Bound(c => c.Celular);
            columns.Bound(c => c.Activo)
                .ClientTemplate("<input type='checkbox' disabled='disabled' name='Activo' <#= Activo? checked='checked' : '' #> />");              
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.Image);
                commands.Delete().ButtonType(GridButtonType.Image);
            }).Title("Opciones"); ;
        })
        .Pageable()
        .Sortable()
        .Scrollable(scrolling => scrolling.Height(250))
        .DataBinding(dataBinding => dataBinding
            .Ajax()
                    .Select("Select", "Vendedor")
                    .Insert("Insert", "Vendedor")
                    .Delete("Delete", "Vendedor")
                    .Update("Update", "Vendedor")
        )
    )
    </div>
    <!-- Table Wrapper End -->
</div>
